/* Radix Context Menu Styles with VSCode theming */

.radix-context-menu-content {
  min-width: 160px;
  background-color: var(--vscode-dropdown-background);
  border: var(--swm-dropdown-border);
  box-shadow: var(--swm-dropdown-shadow);
  border-radius: 6px;
  padding: 4px;
  z-index: 10;
  animation-timing-function: cubic-bezier(0.16, 1, 0.3, 1);
  will-change: transform, opacity;
  animation-duration: 400ms;
  animation-timing-function: cubic-bezier(0.16, 1, 0.3, 1);
}

.radix-context-menu-content[data-side="top"] {
  animation-name: slideDownAndFade;
}

.radix-context-menu-content[data-side="right"] {
  animation-name: slideLeftAndFade;
}

.radix-context-menu-content[data-side="bottom"] {
  animation-name: slideUpAndFade;
}

.radix-context-menu-content[data-side="left"] {
  animation-name: slideRightAndFade;
}

.radix-context-menu-subcontent {
  min-width: 140px;
}

.radix-context-menu-item,
.radix-context-menu-item > .tooltip-trigger-span {
  font-size: 13px;
  line-height: 1;
  color: var(--vscode-menu-foreground);
  border-radius: 4px;
  display: flex;
  align-items: center;
  height: 24px;
  padding: 0 8px;
  position: relative;
  user-select: none;
  outline: none;
  gap: 8px;
  cursor: pointer;

  .codicon-warning {
    color: var(--vscode-problemsWarningIcon-foreground);
  }
}

/* Handle nested tooltip */
.radix-context-menu-item:has(> .tooltip-trigger-span) {
  padding: 0;
}

.radix-context-menu-item[data-disabled],
.radix-context-menu-item[data-disabled] > .tooltip-trigger-span {
  color: var(--vscode-disabledForeground);
  pointer-events: none;
  cursor: default;
}

.radix-context-menu-item[data-highlighted],
.radix-context-menu-item[data-highlighted] > .tooltip-trigger-span {
  background-color: var(--swm-url-select-highlighted-background);
}

.radix-context-menu-subtrigger {
  position: relative;
}

.radix-context-sort-arrow,
.radix-context-menu-arrow {
  margin-left: auto;
  color: inherit;
  font-size: 12px;
  display: flex;
  align-items: center;

  .codicon {
    font-weight: bold;
  }
}

.radix-context-menu-separator {
  height: 1px;
  background-color: var(--swm-url-select-separator);
  margin-inline: 8px;
  margin-bottom: 2px;
  margin-top: 2px;
}

/* Icons */
.radix-context-menu-item .codicon {
  font-size: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

.radix-context-menu-item .codicon-chevron-up,
.radix-context-menu-item .codicon-chevron-down {
  margin-right: 4px;
}

/* Icon colors for different copy types */
.radix-context-menu-item .codicon-terminal {
  /* color: var(--vscode-terminal-ansiGreen); */
  color: var(--green-dark-100);
}

.radix-context-menu-item .codicon-code {
  color: var(--purple-dark-100);
}

.radix-context-menu-item .codicon-link {
  color: var(--blue-dark-100);
}

/* Animations */
@keyframes slideUpAndFade {
  from {
    opacity: 0;
    transform: translateY(2px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes slideRightAndFade {
  from {
    opacity: 0;
    transform: translateX(-2px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes slideDownAndFade {
  from {
    opacity: 0;
    transform: translateY(-2px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes slideLeftAndFade {
  from {
    opacity: 0;
    transform: translateX(2px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

/* Hover styles for non-touch devices */
@media (hover: hover) {
  .radix-context-menu-item:hover:not([data-disabled]) {
    outline: none;
    background-color: var(--swm-url-select-highlighted-background);
    cursor: pointer;
  }
}
